import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// import ViewUIPlus from 'view-ui-plus'
// import 'view-ui-plus/dist/styles/viewuiplus.css'
//导入全局样式表
import '@/assets/css/global.css'
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//使用axios
// import axios from 'axios'
// axios.defaults.baseURL='http://localhost:9000/'
// createApp(App).use(store).use(router).use(element).mount('#app')

//全局定义
// import getConfig from '@/components/request/api'

//导入自定义表格组件
import CommentForm from '@/components/commen/Form.vue'
import CommentHeader from '@/components/commen/Header.vue'
import CommButton from '@/components/commen/Button.vue'
import CustomCommButton from '@/components/commen/CustomCommButton.vue'
import CommPage from '@/components/commen/CommPage.vue'
import CustomCommTable from '@/components/commen/CustomCommTable.vue'
import TestComm from '@/components/commen/testComm.vue'
import CustomImg from '@/components/commen/customImg/customImg.vue'
import XtxMessage from '@/components/commen/xtxMessage.js'
import {post} from '@/components/request/api'
import {resetPost} from '@/components/request/encryptionReqApi'
import locale from 'element-plus/es/locale/lang/zh-cn'

import * as encryptionReqAipMethods from '@/components/request/encryptionReqApi'
//导入测试组件
import Test from '@/components/test/test.vue'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.component('commentForm',CommentForm)
app.component('TestComm',TestComm)
app.component('CommPage',CommPage)
app.component('commentHeader',CommentHeader)
app.component('CommButton',CommButton)
app.component('CustomCommButton',CustomCommButton)
app.component('CustomCommTable',CustomCommTable)
app.component('customImg',CustomImg)
// app.component('xtxMessage',XtxMessage)
/*设置中文包*/
app.use(ElementPlus,{locale})
// app.use(ViewUIPlus)
app.use(router)
// app.config.globalProperties.$getConfig = getConfig; //用$与组件内自定义的函数区分，其他符号也可以

//全局定义
// app.use(getConfig);
app.use(store)

app.config.globalProperties.$xtxMessage=XtxMessage
app.config.globalProperties.$post=post
app.config.globalProperties.$resetPost=resetPost
// 创建应用程序实例并添加全局方法
app.config.globalProperties = {
    ...app.config.globalProperties,
    ...encryptionReqAipMethods
};
app.mount('#app')
